<template>
	<view>
		<!-- <view class="page-section page-section-gap">
			<map style="width: 100%; height: 160px;" :latitude="latitude" :longitude="longitude"
				:markers="covers"></map>
		</view> -->
		<!-- <view class="row-bottom">
			<map id="map" :longitude="longitude" :latitude="latitude" :scale="scale" :circles="circles"
				:markers="markers" :polyline="polyline" show-location style="width: 100%; height: 500rpx;"></map>
		</view>
 -->
		<cover-view class="buttom-view-icon-button" @click="moveTolocation">
			<cover-image src="/static/map/location.png" class="buttom-view-icon-button-img"></cover-image>
		</cover-view>

	</view>
</template>

<script>
	export default {
		name: "ToMap",
		data() {
			return {
				// markers: [{
				// 	id: "0",
				// 	// latitude: that.latitude,
				// 	// longitude: that.longitude,
				// 	width: 50,
				// 	height: 50,
				// 	// iconPath: '../../static/img/location.png',
				// 	title: "提示"
				// }],
				// 地图经纬度
				// title: 'map',
				// latitude: 28.26578706,
				// longitude: 117.07557543,
				// covers: [{
				// 	latitude: 28.26578706,
				// 	longitude: 117.07557543,
				// 	// iconPath: '../../static/my/map.png',
				// 	width: 32,
				// 	height: 32,
				// }]
			};
		},
		create() {
			this.moveTolocation()
			// uni.getLocation({
			// 	type: 'gcj02', // 默认为 wgs84 返回 gps 坐标，gcj02 返回可用于 wx.openLocation 的坐标
			// 	success: function(res) {
			// 		console.log(res, 'www')
			// 		// this.latitude = res.latitude;
			// 		// this.longitude = res.longitude;
			// 		console.log(res, 'res.latitude', )
			// 	}
			// })
		},

		methods: {
			moveTolocation() {
				let mapObjs = uni.createMapContext('mapId', this)
				mapObjs.moveToLocation({
					latitude: 25.01335131460308,
					longitude: 121.53562913165706
				}, {
					complete: res => {
						console.log('移动完成:', res)
					}
				})
				// this.onRegionChange('',true)
			},
		}
	}
</script>

<style>

</style>
